/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tables;

/**
 *
 * @author Pete
 */
public class TableLookup {
    public static <T extends Enum & Tabulable> T Lookup(Class<T> table, int score) {
        T[] values = table.getEnumConstants();
        for(T v : values) {
            if(v.getRange().contains(score))
                return v;
        }
        throw new IndexOutOfBoundsException();
    }
}
